package com.yc.vote.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDate;
import java.util.List;

/**
 * <p>
 * 投票系统-题目表-2
 * </p>
 *
 * @author baomidou
 * @since 2024-04-14
 */
@TableName("tp_vote")
@Data
public class Vote implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 编号, 自增列
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 标题
     */
    private String vname;

    /**
     * 类型: 单选, 多选
     */
    private String vtype;

    /**
     * 开始时间: 开始投票的时间
     */
    private LocalDate startDate;

    /**
     * 结束时间: 投票结束的时间
     */
    private LocalDate endDate;

    /**
     * 投票发起人: 外键关联用户表id
     */
    private Integer usid;

    // 选项集合，默认情况下，实体类全部属性认定为数据库字段
    // 扩展属性，要加注解排除掉
    @TableField(exist = false)
    private List<Items> items;

    //参与投票的网友数量
    @TableField(exist = false)
    private int unum;

    private Integer status;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getVname() {
        return vname;
    }

    public void setVname(String vname) {
        this.vname = vname;
    }

    public String getVtype() {
        return vtype;
    }

    public void setVtype(String vtype) {
        this.vtype = vtype;
    }

    public LocalDate getStartDate() {
        return startDate;
    }

    public void setStartDate(LocalDate startDate) {
        this.startDate = startDate;
    }

    public LocalDate getEndDate() {
        return endDate;
    }

    public void setEndDate(LocalDate endDate) {
        this.endDate = endDate;
    }

    public Integer getUsid() {
        return usid;
    }

    public void setUsid(Integer usid) {
        this.usid = usid;
    }


}
